﻿@using UA.Framework.Authorization

@model UA.Framework.Views.LoginView
@{
    ViewBag.Title = "Login";
}

<h2>Login - 登录页面</h2>
登录状态：@UA.Framework.Authorization.UAAuthentication.IsAuthenticated
<hr />

<script type="text/javascript">
    if (!$.util.isUtilTop) {
        $.util.top.location.href = window.location.href;
    }
</script>


@if (UAAuthentication.IsAuthenticated)
{
    @Html.Partial("~/Views/Shared/_LoginPartial.cshtml")
}
else
{
    <div class="easyui-panel" data-options="title: '登录页面', width: 400, height: 280, collapsible: true">
        @using (Html.BeginForm("Login", "Home", FormMethod.Post, new { id = "loginForm", @class = "login-form" }))
        {
            @Html.AntiForgeryToken()
            @Html.Hidden("returnUrl", this.Request["returnUrl"])
            <p>
                @Html.LabelFor(m => m.LoginCode)
                @Html.TextBoxFor(m => m.LoginCode, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[3, 32]'" } })
            </p>
            <p>
                @Html.LabelFor(m => m.Password)
                @Html.PasswordFor(m => m.Password, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[1, 32]'" } })
            </p>
            <p>
                @Html.LabelFor(m => m.Captcha)
                @Html.TextBoxFor(m => m.Captcha, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "validType: 'length[3, 6]'" } })
            </p>
            <p>
                @Html.CheckBoxFor(m => m.RememberMe)
                @Html.LabelFor(m => m.RememberMe)
            </p>
            <hr />
            <p>
                <input class="submit" type="button" value="登录" />
                <input class="reset" type="button" value="重置" />
            </p>
        }
    </div>
}